﻿using System;
using SharpDX;

namespace MikadoShooter
{
    public static class Background
    {
        private static readonly BackgroundLines[] backgroundLineses;

        static Background()
        {
            backgroundLineses = new BackgroundLines[Enum.GetNames(typeof(eWall)).Length];
            backgroundLineses[(int)eWall.DownRight] = new BackgroundLines(new Vector4(1.0f, -0.9f, 0.0f, 1.0f), new Vector4(0.0f, -1.0f, 0.0f, 1.0f));
            backgroundLineses[(int)eWall.DownLeft] = new BackgroundLines(new Vector4(-1.0f, -0.9f, 0.0f, 1.0f), new Vector4(0.0f, -1.0f, 0.0f, 1.0f));
            backgroundLineses[(int)eWall.Down] = new BackgroundLines(new Vector4(-1.0f, -1.0f, 0.0f, 1.0f), new Vector4(1.0f, -1.0f, 0.0f, 1.0f));
            backgroundLineses[(int)eWall.Right] = new BackgroundLines(new Vector4(1.0f, -1.0f, 0.0f, 1.0f), new Vector4(1.0f, 1.0f, 0.0f, 1.0f));
            backgroundLineses[(int)eWall.Left] = new BackgroundLines(new Vector4(-1.0f, -1.0f, 0.0f, 1.0f), new Vector4(-1.0f, 1.0f, 0.0f, 1.0f));
            backgroundLineses[(int)eWall.Up] = new BackgroundLines(new Vector4(-1.0f, 1.0f, 0.0f, 1.0f), new Vector4(1.0f, 1.0f, 0.0f, 1.0f));
            backgroundLineses[(int)eWall.EndLine] = new BackgroundLines(new Vector4(-1.0f, -0.8f, 0.0f, 1.0f), new Vector4(1.0f, -0.8f, 0.0f, 1.0f));
        }

        public static BackgroundLines GetLine(eWall wallName)
        {
            return backgroundLineses[(int)wallName];
        }

        public class BackgroundLines
        {
            public Vector4 Start { get; private set; }
            public Vector4 End { get; private set; }

            public BackgroundLines(Vector4 start, Vector4 end)
            {
                Start = start;
                End = end;
            }
        }
    }
}